<template>
    <div class="home">
        <el-container>
            <el-header class="headBody">
                <div class="headBody_left">
                    <img src="@/assets/img/dllogo.png" alt="" />
                    <div>生产质量数字化监控系统</div>
                </div>
                <div class="headBody_right">
                    <el-button class="head_text" type="text" icon="el-icon-s-home">APP</el-button>
                    <el-button class="head_text" type="text" icon="el-icon-s-home"
                        @click="goHome($router.push({ path: '/index' }))">首页</el-button>
                    <el-button class="head_text" type="text" icon="el-icon-d-arrow-right" @click="back()">退出</el-button>
                    <el-button class="head_text" type="text" icon="el-icon-rank" @click="screen">全屏</el-button>
                </div>
            </el-header>
            <el-main>
                <el-container style="height: 100%">
                    <el-aside :width="isCollapse ? '50px' : '200px'">
                        <i class="el-icon-s-fold toggle-button" @click="toggleCollapse" v-if="isCollapse == false"></i>
                        <i class="el-icon-s-unfold toggle-button" @click="toggleCollapse" v-else></i>
                        <!-- 菜单 -->
                        <el-menu :default-active="activePath" router unique-opened :collapse-transition="false"
                            :collapse="isCollapse" class="sidebar el-menu-vertical-demo" @select="openMenu"
                            active-text-color="rgb(51, 85, 199)" text-color="#fff">
                            <!-- 一级循环 -->
                            <fragment v-for="(v, i) in leftNameData" :key="i">
                                <el-submenu :index="i + ''">
                                    <template slot="title">
                                        <i :class="v.img" :style="{ 'width': v.width }"></i>
                                        <span slot="title">{{ v.title }}</span>
                                    </template>
                                    <!-- 二级循环 -->
                                    <div v-for="(arr, num) in v.children" :key="num">
                                        <!-- 没有三级 -->
                                        <div v-if="arr.children.length == 0 && arr.lever == 0"
                                            style="display: flex; align-items: center">
                                            <el-menu-item :index="arr.path">
                                                <template slot="title">
                                                    <!-- 跳查看 -->
                                                    <div class="secondaryView">
                                                        <i :class="arr.img" :style="{ 'width': arr.width }"></i>
                                                        <span class="meneTitle" slot="title">
                                                            {{ arr.title }}</span>
                                                    </div>
                                                </template>
                                            </el-menu-item>
                                            <!-- 跳编辑 -->
                                            <el-menu-item v-if="arr.path2" :index="arr.path2" class="el-icon-edit">
                                            </el-menu-item>
                                        </div>
                                        <div v-if="arr.children.length == 0 && arr.lever == 1"
                                            style="display: flex; align-items: center">
                                            <el-menu-item :index="arr.path" style="padding-left: 23px !important">
                                                <template slot="title">
                                                    <i :class="arr.img" :style="{ 'width': arr.width }"></i>
                                                    <div class="secondaryView">
                                                        <span class="meneTitle" slot="title">{{
                                                            arr.title
                                                        }}</span>
                                                    </div>
                                                </template>
                                            </el-menu-item>
                                        </div>
                                        <div class="eidtMenu" v-if="arr.children.length == 0 && arr.lever == 2"
                                            style="display: flex; align-items: center">
                                            <div
                                                style="padding-left: 23px !important;width: 100%;box-sizing: border-box;padding-right: 15px;">
                                                <div slot="title"
                                                    style="display: flex;width: 100%;justify-content: space-between;">
                                                    <el-menu-item :index="arr.path">
                                                        <template slot="title">
                                                            <!-- 跳查看 -->
                                                            <div class="secondaryView">
                                                                <i :class="arr.img" :style="{ 'width': arr.width }"></i>
                                                                <span class="meneTitle" slot="title">{{
                                                                    arr.title
                                                                }}</span>
                                                            </div>
                                                        </template>
                                                    </el-menu-item>
                                                    <!-- 跳编辑 -->
                                                    <el-menu-item v-if="arr.path2" :index="arr.path2" class="el-icon-edit">
                                                    </el-menu-item>
                                                </div>
                                            </div>
                                        </div>

                                        <!-- 有三级 -->
                                        <div v-else>
                                            <el-submenu :index="i + num + 's1'" v-if="arr.lever == 0" style="
                                  padding-left: 15px !important;
                                  box-sizing: border-box;
                                ">

                                                <template slot="title">
                                                    <i :class="arr.img" :style="{ 'width': arr.width }"></i>
                                                    <span class="meneTitle" slot="title">{{
                                                        arr.title
                                                    }}</span>
                                                </template>
                                                <!-- 三级循环 -->

                                                <el-menu-item :index="h.path" v-for="(h, index) in arr.children"
                                                    :key="index" style="width: 50% !important; margin-left: 28px">
                                                    <template slot="title">
                                                        <i :class="h.img" :style="{ 'width': h.width }"></i>
                                                        <span class="meneTitle" slot="title">{{
                                                            h.title
                                                        }}88</span>
                                                    </template>




                                                </el-menu-item>

                                                <!-- 三级循环 -->




                                                <div v-for="(j, num) in arr.children" :key="num">
                                                    <!-- 没有三级 -->
                                                    <div v-if="j.children.length == 0 && j.lever == 0"
                                                        style="display: flex; align-items: center">
                                                        <!-- :style="{'padding-left':isCollapse? '':'60px'}" -->
                                                        <el-menu-item :index="j.path">
                                                            <template slot="title">
                                                                <!-- 跳查看 -->
                                                                <div class="secondaryView">
                                                                    <i :class="j.img" :style="{ 'width': j.width }"></i>
                                                                    <span class="meneTitle" slot="title">
                                                                        {{ j.title }}</span>
                                                                </div>
                                                            </template>
                                                        </el-menu-item>
                                                        <!-- 跳编辑 -->
                                                        <el-menu-item v-if="j.path2" :index="j.path2" class="el-icon-edit">
                                                        </el-menu-item>
                                                    </div>
                                                    <div v-if="j.children.length == 0 && j.lever == 1"
                                                        style="display: flex; align-items: center">
                                                        <el-menu-item :index="j.path" style="padding-left: 23px !important">
                                                            <template slot="title">
                                                                <i :class="j.img" :style="{ 'width': j.width }"></i>
                                                                <div class="secondaryView">
                                                                    <span class="meneTitle" slot="title">{{
                                                                        j.title
                                                                    }}</span>
                                                                </div>
                                                            </template>
                                                        </el-menu-item>
                                                    </div>
                                                    <div class="eidtMenu" v-if="j.children.length == 0 && j.lever == 2"
                                                        style="display: flex; align-items: center">
                                                        <div
                                                            style="padding-left: 23px !important;width: 100%;box-sizing: border-box;padding-right: 15px;">
                                                            <div slot="title"
                                                                style="display: flex;width: 100%;justify-content: space-between;">
                                                                <el-menu-item :index="j.path">
                                                                    <template slot="title">
                                                                        <!-- 跳查看 -->
                                                                        <div class="secondaryView">
                                                                            <i :class="j.img"
                                                                                :style="{ 'width': j.width }"></i>
                                                                            <span class="meneTitle" slot="title">{{
                                                                                j.title
                                                                            }}99</span>
                                                                        </div>
                                                                    </template>
                                                                </el-menu-item>
                                                                <!-- 跳编辑 -->
                                                                <el-menu-item v-if="j.path2" :index="j.path2"
                                                                    class="el-icon-edit">
                                                                </el-menu-item>
                                                            </div>
                                                        </div>
                                                    </div>
                                                    <!-- 有三级 -->
                                                    <div v-else>
                                                        <el-submenu :index="i + num + 's2'" v-if="j.lever == 0" style="
                                  padding-left: 15px !important;
                                  box-sizing: border-box;
                                ">
                                                            <template slot="title">
                                                                <i :class="j.img" :style="{ 'width': j.width }"></i>
                                                                <span class="meneTitle" slot="title">{{
                                                                    j.title
                                                                }}</span>
                                                            </template>
                                                            <!-- 三级循环 -->

                                                            <el-menu-item :index="k.path" v-for="(k, index) in j.children"
                                                                :key="index"
                                                                style="width: 50% !important; margin-left: 28px">
                                                                <template slot="title">
                                                                    <i :class="k.img" :style="{ 'width': k.width }"></i>
                                                                    <span class="meneTitle" slot="title">{{
                                                                        k.title
                                                                    }}</span>
                                                                </template>




                                                            </el-menu-item>


                                                        </el-submenu>
                                                    </div>
                                                </div>
                                            </el-submenu>
                                        </div>
                                    </div>
                                </el-submenu>
                            </fragment>
                        </el-menu>
                        <div class="userInfo">
                            <div class="iconsv">
                                <img class="iconimg" :src="userInfo.gender == 0 ? girls : boys" alt="" />
                                <!-- <img src="../assets/img/organization/boys.png" alt=""> -->
                            </div>
                            <div class="name">{{ userInfo.realName }}</div>
                        </div>
                    </el-aside>

                    <el-container>
                        <div class="content">
                            <router-view v-if="isReloadAlive" />
                        </div>
                    </el-container>
                </el-container>
            </el-main>
        </el-container>
</div>
</template>

<script>
export default {
    name: "Home",
    components: {
        // PositionTitle,
        // Mechanisma,
    },
    provide() {
        return {
            reload: this.reload,
        };
    },

    data() {
        return {
            isReloadAlive: true,
            // 是否全屏
            fullscreen: false,
            // 被激活的链接地址
            activePath: "/index",
            // 是否折叠
            isCollapse: false,
            leftNameData: [
                // {
                //   title: "外检业务数据字典",
                //   img: "iconfont icon-yewu",
                //   name: "dictionaryData",
                //   rank: 1,
                //   children: [
                //     {
                //       title: "试验检测依据管理",
                //       lever: 2,
                //       name: 'experiment',
                //       path: "/experiment",
                //       path2: "/experimentText",
                //       name2: 'experimentText',
                //       img: "iconfont icon-jiancexiangmu",
                //       children: [],
                //       rank: 2,
                //     },
                //     {
                //       title: "样品种类在线管理",
                //       lever: 1,
                //       name: 'sample',
                //       path: "/sample",
                //       path2: "",
                //       img: "iconfont icon-yangpinguanli",
                //       children: [],
                //       rank: 2,
                //     },
                //     {
                //       title: "检测仪器设备管理",
                //       lever: 2,
                //       name: 'instrument',
                //       path: "/instrument",
                //       path2: "/instrumentText",
                //       name2: 'instrumentText',
                //       img: "iconfont icon-shebeijiance",
                //       children: [],
                //       rank: 2,
                //     },
                //   ],
                // },
                // {
                //   title: "施工标段工程划分",
                //   rank: 1,
                //   img: "iconfont icon-xiangmubiaoduanfabu",
                //   name: "projectModule",
                //   children: [

                //     {
                //       title: "标段回弹工程划分",
                //       lever: 1,
                //       name: 'ProjectPage',
                //       path: "/ProjectPage",
                //       path2: "",
                //       img: "iconfont icon-gongcheng",
                //       children: [],
                //       rank: 2,
                //     },
                //   ],
                // },
                {
                    rank: 1,

                    title: "工程建构现场检测",
                    img: "iconfont icon-jurassic_engineer-info",
                    name: 'PCManage',
                    width: '24px',
                    children: [
                        {


                            lever: 0,
                            rank: 2,
                            title: "混凝土回弹检测",
                            img: "iconfont icon-yewu",
                            name: "beton",
                            width: '24px',
                            // children: []
                            children: [
                                {
                                    title: "回弹检测结果管控-1",
                                    lever: 1,
                                    rank: 3,
                                    name: "Control-1",
                                    path: "/Control-1",
                                    path2: "/Control-1Text",
                                    name2: "Control-1Text",
                                    img: "iconfont icon-shengchengbaogao",
                                    children: [],
                                },
                                {
                                    title: "回弹检测结果管控-2",


                                    lever: 1,
                                    rank: 3,
                                    name: "Control-2",
                                    path: "/Control-2",
                                    path2: "/Control-2Text",
                                    name2: "Control-2Text",
                                    img: "iconfont icon-peizhihechajieguobaobiao",
                                    children: [],
                                },
                                {
                                    title: "回弹检测结果管控-3",
                                    lever: 1,
                                    rank: 3,
                                    name: "Control-3",
                                    path: "/Control-3",
                                    path2: "/Control-3Text",
                                    name2: "Control-3Text",
                                    img: "iconfont icon-jieguo",
                                    children: [],
                                },
                            ],
                        },
                        // {
                        //   lever: 0,
                        //   rank: 2,
                        //   title: "钢筋保护层检测",
                        //   img: "iconfont icon-baogaolishichaxun",
                        //   name: 'cover',
                        //   width: '24px',
                        //   // children: []

                        //   children: [
                        //     {

                        //       title: "钢筋保护层检测-1",
                        //       lever: 2,
                        //       rank: 2,
                        //       name: "Steel-1",
                        //       path: "/Steel-1",
                        //       path2: "/Steel-1Text",
                        //       name2: "Steel-1Text",
                        //       img: "iconfont icon-zhibiaojieguo",
                        //       children: [],
                        //     },
                        //     {
                        //       title: "钢筋保护层检测-2",
                        //       lever: 2,
                        //       rank: 2,
                        //       name: "Steel-2",
                        //       path: "/Steel-2",
                        //       path2: "/Steel-2Text",
                        //       name2: "Steel-2Text",
                        //       img: "iconfont icon-yewutongjijieguoguize",
                        //       children: [],
                        //     },


                        //   ],
                        // },
                        {
                            lever: 0,
                            rank: 2,
                            title: "基桩工程检测管理",
                            img: "iconfont icon-jurassic_engineer-info",
                            name: 'pieManage',
                            width: '24px',
                            // children: []

                            children: [
                                {

                                    title: "基桩工程信息",
                                    lever: 1,
                                    rank: 3,
                                    name: "Engineering",
                                    path: "/engineering",
                                    path2: "/engineeringText",
                                    name2: "EngineeringText",
                                    img: "iconfont icon-qingsuanxiangmutongji",
                                    children: [],
                                },
                                {
                                    title: "基桩检测信息",
                                    lever: 1,
                                    rank: 3,
                                    name: "Monitoring",
                                    path: "/Monitoring",
                                    path2: "/MonitoringText",
                                    name2: "MonitoringText",
                                    img: "iconfont icon-shipinjiance",
                                    children: [],
                                },
                                {
                                    title: "基桩检测统计",
                                    lever: 1,
                                    rank: 3,
                                    name: "jisManage",
                                    img: "iconfont icon-tongji",
                                    children: [
                                        {
                                            title: "按建设项目统计",
                                            path: "/building",
                                            path2: "",
                                            img: "iconfont icon-gongchengxiangmuxinxi",
                                            children: [],
                                            name: "building",
                                            rank: 4,
                                        },
                                        {
                                            title: "按施工标段统计",
                                            path: "/section",
                                            path2: "",
                                            img: "iconfont icon-xiangmubiaoduanshezhi",
                                            children: [],
                                            rank: 4,
                                            name: "section",
                                        },
                                        {
                                            title: "按工程项目统计",
                                            path: "/project",
                                            path2: "",
                                            img: "iconfont icon-tongji1",
                                            children: [],
                                            rank: 4,
                                            name: "project"
                                        }
                                    ],
                                },
                                // //测试页面---- 可以删除
                                //  {
                                //   title: "弹框表单-楠",
                                //   lever: 2,
                                //   rank: 2,
                                //   name: "aaa",
                                //   path: "/aaa",
                                //   img: "iconfont icon-yewutongjijieguoguize",
                                //   children: [],
                                // },  {
                                //   title: "弹框表单-娜",
                                //   lever: 2,
                                //   rank: 2,
                                //   name: "bbb",
                                //   path: "/bbb",
                                //   img: "iconfont icon-yewutongjijieguoguize",
                                //   children: [],
                                // },
                                //   //测试页面---- 可以删除

                            ],
                        },
                    ]
                },

                {
                    rank: 1,
                    title: "系统业务数据字典",
                    img: "iconfont icon-jurassic_engineer-info",
                    name: 'currencyManage',
                    width: '24px',
                    children: [

                        {
                            title: "拌合站设置",
                            lever: 1,
                            name: 'mixingPlant',
                            path: "/mixingPlant",
                            path2: "",
                            img: "iconfont icon-yangpinguanli",
                            children: [],
                            rank: 2,
                            width: '24px',
                        },
                        {
                            title: "报警参数设置",
                            lever: 1,
                            name: 'alarmParameterSetting',
                            path: "/alarmParameterSetting",
                            path2: "",
                            img: "iconfont icon-yangpinguanli",
                            children: [],
                            rank: 2,
                            width: '24px',
                        },

                    ],
                },
                {
                    rank: 1,

                    title: "砼拌和生产质量管控",
                    img: "iconfont icon-jurassic_engineer-info",
                    name: 'HntManage',
                    width: '24px',
                    children: [

                        {
                            lever: 1,
                            path: "/supervisionList",
                            path2: "",
                            img: "iconfont icon-tongji",
                            children: [],
                            rank: 2,
                            title: "拌和生产数据信息",
                            name: "dtManage",
                            width: '24px',

                            // children: [
                            //   {
                            //     title: "实时监控",
                            //     path: "/supervisionList",
                            //     path2: "",
                            //     img: "iconfont icon-gongchengxiangmuxinxi",
                            //     children: [],
                            //     name: "supervisionList",
                            //     rank: 3,
                            //   }
                            // ],
                        },

                        {



                            lever: 1,

                            path2: "",
                            img: "iconfont icon-tongji",

                            children: [],
                            rank: 2,
                            title: "拌和生产超标监控",
                            path: "/closure",
                            width: '24px',
                            // children: [
                            //   {
                            //     title: "超标记录",
                            //     path: "/closure",
                            //     path2: "",
                            //     img: "iconfont icon-gongchengxiangmuxinxi",
                            //     children: [],
                            //     name: "closure",
                            //     rank: 3,
                            //   }
                            // ],
                        },
                        {
                            title: "拌和生产统计分析",
                            lever: 0,
                            rank: 2,
                            name: "dtManage",
                            img: "iconfont icon-tongji",
                            width: '24px',
                            children: [
                                {
                                    title: "产能分析",
                                    // title: '材料用量',
                                    path: "/deliverability",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "deliverability",
                                    rank: 3,
                                    width: '18px',

                                }, {
                                    title: "材料用量分析",
                                    path: "/Consumption",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "Consumption",
                                    rank: 3,
                                    width: '24px',
                                }, {
                                    title: "材料偏差走势",
                                    path: "/deviationTrend",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "deviationTrend",
                                    rank: 3,
                                    width: '24px',
                                }, {
                                    title: "生产时间段分析",
                                    path: "/timePeriod",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "timePeriod",
                                    rank: 3,
                                    width: '24px',
                                },
                            ],
                        }, {
                            title: "统计报表",
                            lever: 0,
                            rank: 2,
                            name: "stManage",
                            img: "iconfont icon-tongji",
                            width: '24px',
                            children: [
                                {
                                    title: "混凝土产量统计",
                                    // title: '材料用量',
                                    path: "/output",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "output",
                                    rank: 3,
                                    width: '18px',

                                }, {
                                    title: "混凝土超标统计",
                                    path: "/exceedance",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "exceedance",
                                    rank: 3,
                                    width: '24px',
                                }, {
                                    title: "原材消耗统计",
                                    path: "/material",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "material",
                                    rank: 3,
                                    width: '24px',
                                }
                            ],
                        }, {
                            title: "生产管理",
                            lever: 0,
                            rank: 2,
                            name: "pcManage",
                            img: "iconfont icon-tongji",
                            width: '24px',
                            children: [
                                {
                                    title: "生产用量",
                                    // title: '材料用量',
                                    path: "/productionAmount",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "productionAmount",
                                    rank: 3,
                                    width: '24px',

                                }, {
                                    title: "用量偏差",
                                    path: "/dosageDeviation",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "dosageDeviation",
                                    rank: 3,
                                    width: '24px',
                                }, {
                                    title: "材料用量",
                                    path: "/materialConsumption",
                                    path2: "",
                                    img: "iconfont icon-gongchengxiangmuxinxi",
                                    children: [],
                                    name: "materialConsumption",
                                    rank: 3,
                                    width: '24px',
                                }
                            ],
                        }
                        // //测试页面---- 可以删除
                        //  {
                        //   title: "弹框表单-楠",
                        //   lever: 2,
                        //   rank: 2,
                        //   name: "aaa",
                        //   path: "/aaa",
                        //   img: "iconfont icon-yewutongjijieguoguize",
                        //   children: [],
                        // },  {
                        //   title: "弹框表单-娜",
                        //   lever: 2,
                        //   rank: 2,
                        //   name: "bbb",
                        //   path: "/bbb",
                        //   img: "iconfont icon-yewutongjijieguoguize",
                        //   children: [],
                        // },
                        //   //测试页面---- 可以删除

                    ],
                },
                {
                    rank: 1,
                    title: "系统管理",
                    img: "iconfont icon-xitongguanli",
                    name: "SysManage",
                    width: '24px',
                    children: [
                        {
                            title: "组织机构",
                            rank: 2,
                            img: "iconfont icon-zuzhijigou-jianying",
                            name: "BaseManage",
                            lever: 0,
                            width: '24px',
                            children: [
                                {
                                    title: "机构管理",
                                    path: "/mechanism",
                                    path2: "",
                                    img: "iconfont icon-jigouguanli1",
                                    children: [],
                                    name: "CompanyManage",
                                    rank: 3,
                                    width: '24px',
                                },
                                {
                                    title: "部门管理",
                                    path: "/department",
                                    path2: "",
                                    img: "iconfont icon-untitled85",
                                    children: [],
                                    rank: 3,
                                    name: "DepartmentManage",
                                    width: '24px',
                                },
                                {
                                    title: "岗位管理",
                                    path: "/postManagement",
                                    path2: "",
                                    img: "iconfont icon-icon",
                                    children: [],
                                    rank: 3,
                                    name: "PostManage",
                                    width: '24px',
                                },
                                {
                                    title: "角色管理",
                                    path: "/roleManagement",
                                    path2: "",
                                    img: "iconfont icon-jurassic_role",
                                    children: [],
                                    rank: 3,
                                    name: "RoleManage",
                                    width: '24px',
                                },
                                {
                                    title: "用户管理",
                                    path: "/user",
                                    path2: "",
                                    img: "iconfont icon-Management",
                                    children: [],
                                    rank: 3,
                                    name: "UserManage",
                                    width: '24px',
                                },
                            ],
                        },
                        {
                            title: "数据字典",
                            img: "iconfont icon-shujuzidian-jianying",
                            path: "/dictionaryPage",
                            path2: "",
                            name: "dictionaryPage",
                            lever: 1,
                            rank: 2,
                            children: [],
                            width: '24px',
                        },
                        {
                            title: "敏捷开发",
                            rank: 2,
                            img: "iconfont icon-zuzhijigou-jianying",
                            name: "BaseManage",
                            lever: 0,
                            width: '24px',
                            children: [
                                {
                                    title: "代码生成器",
                                    path: "/codeGenerator",
                                    path2: "",
                                    img: "iconfont icon-jigouguanli1",
                                    children: [],
                                    name: "CompanyManage",
                                    rank: 3,
                                    width: '24px',
                                },
                                {
                                    title: "列表模板",
                                    path: "/table",
                                    path2: "",
                                    img: "iconfont icon-untitled85",
                                    children: [],
                                    rank: 3,
                                    name: "DepartmentManage",
                                    width: '24px',
                                },
                                {
                                    title: "下拉框",
                                    path: "/select",
                                    path2: "",
                                    img: "iconfont icon-icon",
                                    children: [],
                                    rank: 3,
                                    name: "PostManage",
                                    width: '24px',
                                },
                                {
                                    title: "树状图",
                                    path: "/tree",
                                    path2: "",
                                    img: "iconfont icon-jurassic_role",
                                    children: [],
                                    rank: 3,
                                    name: "RoleManage",
                                    width: '24px',
                                },
                                {
                                    title: "上传文件",
                                    path: "/upload",
                                    path2: "",
                                    img: "iconfont icon-Management",
                                    children: [],
                                    rank: 3,
                                    name: "UserManage",
                                    width: '24px',
                                },
                            ],
                        },
                        {
                            title: "系统功能",
                            img: "iconfont icon-xitonggongneng",
                            path: "/systemData",
                            path2: "",
                            name: "systemData",
                            lever: 1,
                            rank: 2,
                            children: [],
                            width: '24px',
                        },
                    ],
                },
            ],
            fristModule: [],
            userInfo: {},
            boys: require("../assets/img/organization/boys.png"),
            girls: require("../assets/img/organization/girls.png"),
        };
    },
    created() {

        // this.setCurrentRoute()
        // this.activePath = window.sessionStorage.getItem("GxBack-activePath");
    },
    mounted() {

        this.activePath = sessionStorage.getItem("GxBack-keyPath") || "/index";
        // this.roleModule()

        this.userInfo = JSON.parse(sessionStorage.getItem('GxBack-userInfo'))

    },
    watch: {
        activePath(newValue) {
            if (newValue != this.$route.path) {
                this.activePath = this.$route.path;
            }
        },
        // $route() {
        //   this.setCurrentRoute()
        // }
    },

    methods: {
        roleModule() {

            var ModuleList = JSON.parse(sessionStorage.getItem('GxBack-ModuleList'))

            var fristModule = []
            if (ModuleList.length != 0) {


                this.leftNameData.map((i) => {//筛选大模块
                    ModuleList.map((item) => {
                        if (item.fEncode == i.name) {
                            fristModule.push(i)
                        }
                    })
                })



                fristModule.map((item) => {//只有两级
                    item['childrens'] = []
                    item.children.map((i) => {
                        ModuleList.map((j) => {
                            if (i.name == j.fEncode) {
                                item['childrens'].push(i)
                            }
                        })
                    })
                    item.children = item.childrens
                })
                // 有三级
                fristModule.map((item) => {
                    item.children.map((i) => {//二级
                        i['childrens'] = []
                        i.children.map(h => {//循环3级
                            ModuleList.map((j) => {
                                if (h.name == j.fEncode) {
                                    i['childrens'].push(h)
                                }
                            })
                        })

                        i.children = i.childrens
                    })
                })

                fristModule.map(item => {
                    item.children.map(i => {
                        if (i.rank == 2) {
                            i.path2 = ""
                            ModuleList.map((j) => {
                                if (i.name2 == j.fEncode) {
                                    i.path2 = i.path + "Text"
                                }
                            })
                        }

                    })
                })
                // fristModule.map(item => {
                //   item.children.map(i => {
                //     i.children = []
                //   })
                // })

                this.leftNameData = fristModule
            } else {
                var data = this.leftNameData
                this.leftNameData = data
            }
        },

        // findItemName(arr) {
        //   const len = arr.length;
        //   let name;
        //   if (this.id) {
        //     for (let i = 0; i < len; i++) {
        //       if (this.id === arr[i].itemId) {
        //         name = arr[i].itemName;
        //         break;
        //       } else if (arr[i].children && arr[i].children.length) {
        //         name = this.findItemName(arr[i].children);
        //         if (name) break; // 找到就结束循环，避免后续循环覆盖正确结果
        //       }
        //     }
        //   }
        //   return name;
        // },


        reload() {
            this.isReloadAlive = false;
            this.$nextTick(function () {
                this.isReloadAlive = true;
            });
        },

        // setCurrentRoute() {
        //   this.activePath = this.$route.path  //关键  通过他就可以监听到当前路由状态并激活当前菜单
        // },

        // 返回首页
        //     goHome(){
        //       this.$router.push({
        //     path:"/ProjectPage",

        // })
        // },
        openMenu(keyPath) {
            if (keyPath != 'null') {
                sessionStorage.setItem("GxBack-keyPath", keyPath);
            }

        },
        // 是否全屏
        screen() {
            let element = document.documentElement;
            if (this.fullscreen) {
                if (document.exitFullscreen) {
                    document.exitFullscreen();
                } else if (document.webkitCancelFullScreen) {
                    document.webkitCancelFullScreen();
                } else if (document.mozCancelFullScreen) {
                    document.mozCancelFullScreen();
                } else if (document.msExitFullscreen) {
                    document.msExitFullscreen();
                }
            } else {
                if (element.requestFullscreen) {
                    element.requestFullscreen();
                } else if (element.webkitRequestFullScreen) {
                    element.webkitRequestFullScreen();
                } else if (element.mozRequestFullScreen) {
                    element.mozRequestFullScreen();
                } else if (element.msRequestFullscreen) {
                    // IE11
                    element.msRequestFullscreen();
                }
            }
            this.fullscreen = !this.fullscreen;
        },

        toggleCollapse() {
            this.isCollapse = !this.isCollapse;
        },

        back() {
            this.$confirm("是否继续退出?", "提示", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning",
            })
                .then(() => {
                    window.sessionStorage.removeItem("GxBack-token")
                    this.$router.push("/");

                })
                .catch(() => {
                    this.loading = false;
                    this.$message.info("取消退出");

                });



        },
    },
};
</script>
<style scoped lang="less">
a {
    color: #fff;
}

.home {
    width: 100%;
    height: 100%;
    // user-select: none;
}

.home_header {
    background-color: #1559ba;
    text-align: center;
    /* line-height: 50px; */
    height: 10%;
    width: 100%;
}

/* 右侧 */
.main_right {
    width: 100%;
    height: 100%;
    padding: 0 15px;
    box-sizing: border-box;
    overflow: hidden;
}

.main_right_position {
    text-align: left;
    width: 100%;
}

.main_right_table {
    width: 100%;
    height: 90%;
}

.content {
    width: 100%;
    height: 100%;
    padding: 0 5px;
    box-sizing: border-box;
}

.toggle-button {
    display: block;
    background-color: #1559ba;
    font-size: 17px;
    line-height: 30px;
    color: #fff;
    text-align: center;
    letter-spacing: 0.2em;
    cursor: pointer;
}

.el-menu-vertical-demo:not(.el-menu--collapse) {
    /* width: 200px;
    min-height: 400px; */
    background: #0c204d !important;
}

.el-aside {
    position: relative;
}

.userInfo {
    position: absolute;
    width: 100%;
    height: 50px;
    // background: pink;
    bottom: 0;
    display: flex;
    align-items: center;
    border-top: 1px solid #63656B;
    padding: 0 35px 0 25px;
    box-sizing: border-box;
    // justify-content: space-around;

    .iconsv {

        width: 36px;
        height: 36px;
        border-radius: 50%;
        // border: 1px solid green;
        line-height: 0px;
        overflow: hidden;
        margin-right: 15px;

        .iconimg {

            width: 100%;
            height: 100%;
            // border: 1px solid red;
        }
    }

    .name {
        height: 100%;
        line-height: 49px;

        font-size: 12px;
        color: #a6acbc;
    }
}
</style>
